-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add rocketmq binding #554
Conversation
7428107
to
8db234c
Compare
@pierDipi Could you please take a look? |
final ByteBuffer byteBuffer = message.getBody(); | ||
byte[] body = new byte[byteBuffer.remaining()]; | ||
byteBuffer.get(body); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the buffer "copy"? I can see how this is the safest option, however, what if I don't want any additional buffering and copies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually the ByteBuffer
returned is readonly, so we have to copy it.
Thanks @aaron-ai, overall, it looks good and the binding spec seems simple to follow and implement |
@pierDipi Thanks for you review! Could you help to re-run the workflow? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have another suggestion, can we use a single package instead of the impl
package? I know some components in the SDK are using that approach (I'd like to move away from that), however, that forces us to make some APIs public where they could be package-private.
rocketmq/src/main/java/io/cloudevents/rocketmq/impl/RocketmqConstants.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Aaron Ai <yangkun.ayk@alibaba-inc.com>
Signed-off-by: Aaron Ai <yangkun.ayk@alibaba-inc.com>
Very nice suggestion! I have updated the related part according to your suggestion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @aaron-ai!
LGTM
Spec details: https://github.com/apache/rocketmq-externals/blob/a6978cf562db9aab00062704dc15bddf947df9bc/rocketmq-cloudevents-binding/rocketmq-transport-binding.md Signed-off-by: Aaron Ai <yangkun.ayk@alibaba-inc.com> Signed-off-by: Alex Collins <alex_collins@intuit.com>
Fixes #494